/*
 * p3623.cpp
 *
 *  Created on: 2013-5-3
 *      Author: zy
 */

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int t[35], l[35];
int dp[355];
int N,L;
int main()
{
	while (scanf("%d%d", &N, &L) != EOF)
	{
		for (int i = 1; i <= N; i++)
			scanf("%d%d", &t[i], &l[i]);
		memset(dp, 0, sizeof(dp));
		for (int i = 1; i <= N; i++)
			for (int j = t[i]; j <= 350; j++)
				dp[j] = max(dp[j], dp[j - t[i]] + (j - t[i]) * l[i]);
		int ans;
		for (int i = 0; i <= 350; i++)
			if (dp[i] >= L)
			{
				ans = i;
				break;
			}
		printf("%d\n", ans);
	}
	return 0;
}
